<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page language="java" pageEncoding="UTF-8" isELIgnored="false" %>
<%--<%@ taglib uri="/struts-tags" prefix="s"%>--%>
<HTML>
<head>
    <meta http-equiv="Content-Language" content="zh-cn">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link href="${pageContext.request.contextPath}/css/Style1.css" rel="stylesheet" type="text/css" />
    <link href="${pageContext.request.contextPath}/css/common.css" rel="stylesheet" type="text/css"/>
    <script language="javascript" src="${pageContext.request.contextPath}/js/public.js"></script>
    <script type="text/javascript">
        //传递当前页和cid
        function gotopage(page){
            window.location.href="${pageContext.request.contextPath}/adminOrder_findPageBean?page="+page+"";
        }
    </script>
    <style type="text/css">
        td a:link{
            color: red;
        }
    </style>
</head>
<body>
<br>
<form id="Form1" name="Form1"  method="post">
    <table cellSpacing="1" cellPadding="0" width="100%" align="center" bgColor="#f5fafe" border="0">
        <TBODY>
        <tr>
            <td class="ta_01" colspan="2" align="center" bgColor="#afd1f3">
                <strong>订单列 表</strong>
            </td>
        </tr>
        <%--
        <tr>
            <td class="ta_01" align="right">
                <button type="button" id="add" name="add" value="添加" class="button_add" onclick="addproduct()">
                   &#28155;&#21152;
                </button>

            </td>
        </tr>
        --%>
        <tr>
            <td class="ta_01" align="center" bgColor="#f5fafe">
                <table cellspacing="0" cellpadding="1" rules="all"
                       bordercolor="gray" border="1" id="DataGrid1"
                       style="BORDER-RIGHT: gray 1px solid; BORDER-TOP: gray 1px solid; BORDER-LEFT: gray 1px solid; WIDTH: 100%; WORD-BREAK: break-all; BORDER-BOTTOM: gray 1px solid; BORDER-COLLAPSE: collapse; BACKGROUND-COLOR: #f5fafe; WORD-WRAP: break-word">
                    <tr style="FONT-WEIGHT: bold; FONT-SIZE: 12pt; HEIGHT: 25px; BACKGROUND-COLOR: #afd1f3">

                        <td align="center" width="25">
                            订单序号
                        </td>
                        <td align="center" width="10">
                            总计
                        </td>
                        <td align="center" width="20">
                            订单时间
                        </td>
                        <td width="10" align="center">
                            订单状态
                        </td>
                        <td width="10" align="center">
                            收货人
                        </td>
                        <td width="10" align="center">
                            联系电话
                        </td>
                        <td width="20" align="center">
                            收货地址
                        </td>
                        <%--
                        <td width="7%" align="center">
                            编辑
                        </td>
                        <td width="7%" align="center">
                            删除
                        </td>
                        --%>
                    </tr>
                    <c:forEach var="o" items="${olist}">
                        <tr onmouseover="this.style.backgroundColor = 'white'"
                            onmouseout="this.style.backgroundColor = '#F5FAFE';">
                            <td style="CURSOR: hand; HEIGHT: 22px" align="center"
                                width="25">
                                ${o.oid}
                            </td>
                            <td style="CURSOR: hand; HEIGHT: 22px" align="center"
                                width="10">
                                    ${o.total}
                            </td>
                            <td style="CURSOR: hand; HEIGHT: 22px" align="center"
                                width="20">
                                    ${o.ordertime}
                            </td>
                            <td style="CURSOR: hand; HEIGHT: 22px" align="center"
                                width="10">
                                <c:if test="${o.state eq 1}">未付款</c:if>
                                <c:if test="${o.state eq 2}"><a href="${pageContext.request.contextPath}/adminOrder_editState?oid=${o.oid}">发货</a></c:if>
                                <c:if test="${o.state eq 3}">已发货</c:if>
                                <c:if test="${o.state eq 4}">已完成交易</c:if>
                            </td>
                            <td style="CURSOR: hand; HEIGHT: 22px" align="center"
                                width="10">
                                    ${o.name}
                            </td>
                            <td style="CURSOR: hand; HEIGHT: 22px" align="center"
                                width="10">
                                    ${o.phone}
                            </td>
                            <td style="CURSOR: hand; HEIGHT: 22px" align="center"
                                width="20">
                                    ${o.addr}
                            </td>
                                <%--
                                <td align="center" style="HEIGHT: 22px">
                                    <a href="${pageContext.request.contextPath}/adminProduct_edit.action?pid=<s:property value="#p.pid"/>">
                                        <img src="${pageContext.request.contextPath}/images/i_edit.gif" border="0" style="CURSOR: hand">
                                    </a>
                                </td>

                                <td align="center" style="HEIGHT: 22px">
                                    <a href="${pageContext.request.contextPath}/adminProduct_delete.action?pid=<s:property value="#p.pid"/>">
                                        <img src="${pageContext.request.contextPath}/images/i_del.gif" width="16" height="16" border="0" style="CURSOR: hand">
                                    </a>
                                </td>
                            --%>
                        </tr>
                    </c:forEach>
                </table>
            </td>
        </tr>
        </TBODY>
    </table>
    <%--========================显示分页=================================== --%>
    <%--<div>
        第${p.page}页/共${p.pageCount}页
        &lt;%&ndash;页码处理&ndash;%&gt;
        <c:choose>
            &lt;%&ndash;当显示页码时,总页码<=10时，全部显示&ndash;%&gt;
            <c:when test="${p.pageCount<=10}">
                <c:set var="begin" value="1"/>
                <c:set var="end" value="${p.pageCount}"/>
            </c:when>
            &lt;%&ndash;当总页码>10时,只显示10页&ndash;%&gt;
            <c:otherwise>
                <c:set var="begin" value="${p.page-5}"/>
                <c:set var="end" value="${p.page+4}"/>
                &lt;%&ndash;当前页-5后的begin<1时：begin=1, end=10&ndash;%&gt;
                <c:if test="${begin<1}">
                    <c:set var="begin" value="1"/>
                    <c:set var="end" value="10"/>
                </c:if>
                &lt;%&ndash;当前页+4后的end>总页数时:begin=总页数-9,end=总页数&ndash;%&gt;
                <c:if test="${end>p.pageCount}">
                    <c:set var="begin" value="${p.pageCount-9}"/>
                    <c:set var="end" value="${p.pageCount}"/>
                </c:if>
            </c:otherwise>
        </c:choose>
        &lt;%&ndash;样式及显示&ndash;%&gt;
        <nav aria-label="...">

            <ul class="pagination">
                <li><a href="${pageContext.request.contextPath}/adminProduct?page=1">首页</a></li>

                &lt;%&ndash;上一页&ndash;%&gt;
                <c:if test="${p.page>1}">
                    <li class="">
                        <a href="${pageContext.request.contextPath}/adminProduct?page=${p.page-1}" aria-label="Previous">
                            <span aria-hidden="true">&laquo;</span></a>
                    </li>
                </c:if>

                &lt;%&ndash;<li class="active"><a href="#">1 <span class="sr-only">(current)</span></a></li>&ndash;%&gt;
                <c:forEach var="num" begin="${begin}" end="${end}">
                    &lt;%&ndash;显示页码时，是当前页，则不显示超链接&ndash;%&gt;
                    <c:choose>
                        <c:when test="${num==p.page}">&lt;%&ndash;ne:不等于&ndash;%&gt;
                            <li class="active">
                                <span>${num}<span class="sr-only">(current)</span></span>&lt;%&ndash;a标签改为span标签&ndash;%&gt;
                            </li>
                        </c:when>
                        <c:otherwise>
                            <li class="">
                                <a href="${pageContext.request.contextPath}/adminProduct?page=${num}">${num} <span class="sr-only">(current)</span></a>
                            </li>
                        </c:otherwise>
                    </c:choose>
                </c:forEach>

                &lt;%&ndash;当前页面为最后一页时不显示下一页&ndash;%&gt;
                <c:if test="${p.page<p.pageCount}">
                    <li>
                        <a href="${pageContext.request.contextPath}/adminProduct?page=${p.page+1}" aria-label="Next">
                            <span aria-hidden="true">&raquo;</span>
                        </a>
                    </li>
                </c:if>

                <li><a href="${pageContext.request.contextPath}/adminProduct?page=${p.pageCount}">尾页</a></li>
            </ul>
        </nav>
    </div>--%>
</form>

</body>
</HTML>

